﻿<Window x:Class="WpfExample.Example2"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:wu="clr-namespace:Monogram.WpfUtils;assembly=WpfUtils"
        Title="Example2" Height="300" Width="300">
  <Grid  d:DataContext="{d:DesignData /SampleData/ViewModelSampleData.xaml}" >

    <wu:DetailsView DataContext="{Binding Persons[0]}" AllowEdit="True" AutoGenerateFields="False">
      <wu:DetailsViewRow Header="Nachname">
        <wu:DetailsViewRow.CellTemplate>
          <DataTemplate>
            <TextBox Text="{Binding LastName}"  Margin="2" FontWeight="Bold" />
          </DataTemplate>
        </wu:DetailsViewRow.CellTemplate>
      </wu:DetailsViewRow>
      <wu:DetailsViewRow Header="Vorname" DisplayMemberBinding="{Binding FirstName}" />
      <wu:DetailsViewRow Header="Geburtsdatum" DisplayMemberBinding="{Binding BirthDate, Mode=OneWay, StringFormat=\{\0:dd. MMM. yyyy\}}" />
      <wu:DetailsViewRow Header="Vip" DisplayMemberBinding="{Binding Items}">
        <wu:DetailsViewRow.CellTemplate>
          <DataTemplate>
            <ListBox Margin="2" wu:DetailsView.BindProperty="{x:Static ListBox.ItemsSourceProperty}" />
          </DataTemplate>
        </wu:DetailsViewRow.CellTemplate>
      </wu:DetailsViewRow>
    </wu:DetailsView>
  </Grid>
</Window>
